//
//  ColumnTableViewCell.m
//  PlayerFix
//
//  Created by dllo on 15/11/4.
//  Copyright © 2015年 DAT. All rights reserved.
//

#import "ColumnTableViewCell.h"

@implementation ColumnTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubViews];
    }
    return self;
}

- (void)createSubViews{
    
    self.myImageView  = [[UIImageView alloc] initWithFrame:CGRectMake(10 * WIDTH, 10 * HEIGHT, 80 * WIDTH, 80 * HEIGHT)];
    [self.contentView addSubview:self.myImageView];
    
    self.titleLabel  = [[UILabel alloc] initWithFrame:CGRectMake(100 * WIDTH, 10 * HEIGHT, 200 * WIDTH, 30 * HEIGHT)];
    [self.contentView addSubview:self.titleLabel];
    
    self.subTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(100 * WIDTH, 50 * HEIGHT, 200 * WIDTH, 40 * HEIGHT)];
    [self.contentView addSubview:self.subTitleLabel];
    
}

- (void)setColumnModel:(ColumnModel *)columnModel{
    
    _columnModel = columnModel;
    [self.myImageView sd_setImageWithURL:[NSURL URLWithString:columnModel.icon_url] placeholderImage:[UIImage imageNamed:@"holderPic_recommend.png"]];
    
    self.titleLabel.text = columnModel.title;
//    NSLog(@"======%@",columnModel.title);
    
    self.subTitleLabel.text = columnModel.subtitle;
    self.subTitleLabel.font = [UIFont systemFontOfSize:13];
    self.subTitleLabel.textColor = [UIColor lightGrayColor];
    self.subTitleLabel.numberOfLines = 2;
    
}

@end
